home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / X11 / XDrawArc.z / XDrawArc
Encoding:
Text File  |  1998-10-30  |  10.0 KB  |  260 lines

  1.  
  2.  
  3.  
  4.      XXXXDDDDrrrraaaawwwwAAAArrrrcccc((((3333XXXX11111111))))     XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333))))      XXXXDDDDrrrraaaawwwwAAAArrrrcccc((((3333XXXX11111111))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           XDrawArc, XDrawArcs, XArc - draw arcs and arc structure
  10.  
  11.      SSSSYYYYNNNNTTTTAAAAXXXX
  12.           XDrawArc(_d_i_s_p_l_a_y, _d, _g_c, _x, _y, _w_i_d_t_h, _h_e_i_g_h_t, _a_n_g_l_e_1,
  13.           _a_n_g_l_e_2)
  14.                 Display *_d_i_s_p_l_a_y;
  15.                 Drawable _d;
  16.                 GC _g_c;
  17.                 int _x, _y;
  18.                 unsigned int _w_i_d_t_h, _h_e_i_g_h_t;
  19.                 int _a_n_g_l_e_1, _a_n_g_l_e_2;
  20.  
  21.           XDrawArcs(_d_i_s_p_l_a_y, _d, _g_c, _a_r_c_s, _n_a_r_c_s)
  22.                 Display *_d_i_s_p_l_a_y;
  23.                 Drawable _d;
  24.                 GC _g_c;
  25.                 XArc *_a_r_c_s;
  26.                 int _n_a_r_c_s;
  27.  
  28.      AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  29.           _a_n_g_l_e_1    Specifies the start of the arc relative to the
  30.                     three-o'clock position from the center, in units
  31.                     of degrees * 64.
  32.  
  33.           _a_n_g_l_e_2    Specifies the path and extent of the arc relative
  34.                     to the start of the arc, in units of degrees * 64.
  35.  
  36.           _a_r_c_s      Specifies an array of arcs.
  37.  
  38.           _d         Specifies the drawable.
  39.  
  40.           _d_i_s_p_l_a_y   Specifies the connection to the X server.
  41.  
  42.           _g_c        Specifies the GC.
  43.  
  44.           _n_a_r_c_s     Specifies the number of arcs in the array.
  45.  
  46.           _w_i_d_t_h
  47.           _h_e_i_g_h_t    Specify the width and height, which are the major
  48.                     and minor axes of the arc.
  49.  
  50.           _x
  51.           _y         Specify the x and y coordinates, which are
  52.                     relative to the origin of the drawable and specify
  53.                     the upper-left corner of the bounding rectangle.
  54.  
  55.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  56.           _X_D_r_a_w_A_r_c draws a single circular or elliptical arc, and
  57.           _X_D_r_a_w_A_r_c_s draws multiple circular or elliptical arcs.  Each
  58.           arc is specified by a rectangle and two angles. The center
  59.           of the circle or ellipse is the center of the rectangle, and
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 4/30/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      XXXXDDDDrrrraaaawwwwAAAArrrrcccc((((3333XXXX11111111))))     XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333))))      XXXXDDDDrrrraaaawwwwAAAArrrrcccc((((3333XXXX11111111))))
  71.  
  72.  
  73.  
  74.           the major and minor axes are specified by the width and
  75.           height.  Positive angles indicate counterclockwise motion,
  76.           and negative angles indicate clockwise motion. If the
  77.           magnitude of angle2 is greater than 360 degrees, _X_D_r_a_w_A_r_c or
  78.           _X_D_r_a_w_A_r_c_s truncates it to 360 degrees.
  79.  
  80.           For an arc specified as
  81.           [ _x, _y, _w_i_d_t_h, _h_e_i_g_h_t, _a_n_g_l_e1, _a_n_g_l_e2], the origin of the
  82.           major and minor axes is at [_x+  2_w_i_d_t_h_____, _y+   2_h_e_i_g_h_t______], and the
  83.           infinitely thin path describing the entire circle or ellipse
  84.           intersects the horizontal axis at [_x, _y+   2_h_e_i_g_h_t______] and
  85.           [_x+_w_i_d_t_h, _y+   2_h_e_i_g_h_t______] and intersects the vertical axis at
  86.           [_x+  2_w_i_d_t_h_____, _y] and [_x+  2_w_i_d_t_h_____, _y+_h_e_i_g_h_t].  These coordinates can
  87.           be fractional and so are not truncated to discrete
  88.           coordinates.  The path should be defined by the ideal
  89.           mathematical path. For a wide line with line-width lw, the
  90.           bounding outlines for filling are given by the two
  91.           infinitely thin paths consisting of all points whose
  92.           perpendicular distance from the path of the circle/ellipse
  93.           is equal to lw/2 (which may be a fractional value).  The
  94.           cap-style and join-style are applied the same as for a line
  95.           corresponding to the tangent of the circle/ellipse at the
  96.           endpoint.
  97.  
  98.           For an arc specified as
  99.           [ _x, _y, _w_i_d_t_h, _h_e_i_g_h_t, _a_n_g_l_e1, _a_n_g_l_e2], the angles must be
  100.           specified in the effectively skewed coordinate system of the
  101.           ellipse (for a circle, the angles and coordinate systems are
  102.           identical).  The relationship between these angles and
  103.           angles expressed in the normal coordinate system of the
  104.           screen (as measured with a protractor) is as follows:
  105.  
  106.           skewed-angle = _a_t_a_n(|(tan(normal-angle)*_h_e_i_g_h_t_w_i_d_t_h______)|)+_a_d_j_u_s_t
  107.  
  108.           The skewed-angle and normal-angle are expressed in radians
  109.           (rather than in degrees scaled by 64) in the range [0, 2J]
  110.           and where atan returns a value in the range [-J_, 2J_] and
  111.           adjust is:
  112.  
  113.           0         for normal-angle in the range [0, 2J_]
  114.           J         for normal-angle in the range [J_,  23J__]
  115.           2J        for normal-angle in the range [ 23J__, 2J]
  116.  
  117.           For any given arc, _X_D_r_a_w_A_r_c and _X_D_r_a_w_A_r_c_s do not draw a
  118.           pixel more than once. If two arcs join correctly and if the
  119.           line-width is greater than zero and the arcs intersect,
  120.           _X_D_r_a_w_A_r_c and _X_D_r_a_w_A_r_c_s do not draw a pixel more than once.
  121.  
  122.  
  123.  
  124.      Page 2                                          (printed 4/30/98)
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.      XXXXDDDDrrrraaaawwwwAAAArrrrcccc((((3333XXXX11111111))))     XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333))))      XXXXDDDDrrrraaaawwwwAAAArrrrcccc((((3333XXXX11111111))))
  132.  
  133.  
  134.  
  135.           Otherwise, the intersecting pixels of intersecting arcs are
  136.           drawn multiple times.  Specifying an arc with one endpoint
  137.           and a clockwise extent draws the same pixels as specifying
  138.           the other endpoint and an equivalent counterclockwise
  139.           extent, except as it affects joins.
  140.  
  141.           If the last point in one arc coincides with the first point
  142.           in the following arc, the two arcs will join correctly. If
  143.           the first point in the first arc coincides with the last
  144.           point in the last arc, the two arcs will join correctly.  By
  145.           specifying one axis to be zero, a horizontal or vertical
  146.           line can be drawn.  Angles are computed based solely on the
  147.           coordinate system and ignore the aspect ratio.
  148.  
  149.           Both functions use these GC components: function, plane-
  150.           mask, line-width, line-style, cap-style, join-style, fill-
  151.           style, subwindow-mode, clip-x-origin, clip-y-origin, and
  152.           clip-mask.  They also use these GC mode-dependent
  153.           components: foreground, background, tile, stipple, tile-
  154.           stipple-x-origin, tile-stipple-y-origin, dash-offset, and
  155.           dash-list.
  156.  
  157.           _X_D_r_a_w_A_r_c and _X_D_r_a_w_A_r_c_s can generate _B_a_d_D_r_a_w_a_b_l_e, _B_a_d_G_C, and
  158.           _B_a_d_M_a_t_c_h errors.
  159.  
  160.      SSSSTTTTRRRRUUUUCCCCTTTTUUUURRRREEEESSSS
  161.           The _X_A_r_c structure contains:
  162.  
  163.           typedef struct {
  164.                short x, y;
  165.                unsigned short width, height;
  166.                short angle1, angle2;             /* Degrees * 64 */
  167.           } XArc;
  168.  
  169.           All x and y members are signed integers.  The width and
  170.           height members are 16-bit unsigned integers.  You should be
  171.           careful not to generate coordinates and sizes out of the
  172.           16-bit ranges, because the protocol only has 16-bit fields
  173.           for these values.
  174.  
  175.      DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  176.           _B_a_d_D_r_a_w_a_b_l_e
  177.                     A value for a Drawable argument does not name a
  178.                     defined Window or Pixmap.
  179.  
  180.           _B_a_d_G_C     A value for a GContext argument does not name a
  181.                     defined GContext.
  182.  
  183.           _B_a_d_M_a_t_c_h  An _I_n_p_u_t_O_n_l_y window is used as a Drawable.
  184.  
  185.           _B_a_d_M_a_t_c_h  Some argument or pair of arguments has the correct
  186.                     type and range but fails to match in some other
  187.  
  188.  
  189.  
  190.      Page 3                                          (printed 4/30/98)
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.      XXXXDDDDrrrraaaawwwwAAAArrrrcccc((((3333XXXX11111111))))     XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333))))      XXXXDDDDrrrraaaawwwwAAAArrrrcccc((((3333XXXX11111111))))
  198.  
  199.  
  200.  
  201.                     way required by the request.
  202.  
  203.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  204.           XDrawLine(3X11), XDrawPoint(3X11), XDrawRectangle(3X11)
  205.           _X_l_i_b - _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.      Page 4                                          (printed 4/30/98)
  257.  
  258.  
  259.  
  260.